package com.pricl.biz.demo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.pricl.frame.core.E;
import com.pricl.frame.core.R;

/**
 * <p>
 * 框架控制器
 * </p>
 * 
 */
@Controller("demo.test.controller")
@RequestMapping("/demo/test")
public class TestController {
	
	@RequestMapping(value = "error", method = RequestMethod.GET)
	public @ResponseBody R error() {
		if(1==1)throw new E(-1000,"测试错误");
		return R.error();
	}

	@RequestMapping(value = "error2", method = RequestMethod.GET)
	public @ResponseBody R error2() {
		return R.error(-1000,null,"测试错误");
	}
	
	
	/*@Autowired
	AdminTenantService service;

	@RequestMapping(value = "index", method = RequestMethod.GET)
	public String index() {
		return "/admin/tenant/index";
	}

	@RequestMapping(value = "list", method = RequestMethod.GET)
	public String list(AdminTenantCriteria criteria, Model model, HttpServletRequest request) {
		PageBounds pageRequest = PageFactory.builderPageBounds(request);
		PageList<AdminTenant> resultList = service.selectByEntityWithRowbounds(criteria, pageRequest);
		model.addAttribute("resultList", resultList);
		model.addAttribute("criteria", criteria);
		if (resultList != null)
			model.addAttribute("paginator", resultList.getPaginator());
		return "/admin/tenant/list";
	}
	
	@RequestMapping(value = "/page", method = RequestMethod.POST)
	public @ResponseBody AdminTenantPage page(AdminTenantPage page, User user) {
		service.page(page);
		return page;
	}*/
	
	
	
	
}
